ff10eb5d29f9aaf80c72cff859dde7bbe5d0490f,community/src/test/java/org/neo4j/server/osgi/OSGiContainerTest.java,OSGiContainerTest,shouldAllowAccessToOSGiServices,#,200
Before Change
{
createContainer();
String expectedBundleSymbolicName = "OSGiServiceProviderBundle";
InputStream bundleStream = newBundle()
.add( ServiceProviderActivator.class )
.add( ExampleServiceImpl.class )
.set( Constants.BUNDLE_SYMBOLICNAME, expectedBundleSymbolicName )
.set( Constants.EXPORT_PACKAGE, "org.neo4j.server.osgi.bundles.service" )
.set( Constants.IMPORT_PACKAGE, "org.neo4j.server.osgi.bundles.service, org.neo4j.server.osgi.services, org.osgi.framework" )
.set( Constants.BUNDLE_ACTIVATOR, ServiceProviderActivator.class.getName() )
.build( withBnd() );
File awareJar = new File( container.getBundleDirectory(), "service-impl.jar" );
OutputStream jarOutputStream = new FileOutputStream( awareJar );
StreamUtils.copyStream( bundleStream, jarOutputStream, true );
container.start();
After Change
{
createContainer();
ServiceProviderActivator serviceProvider = new ServiceProviderActivator();
serviceProvider.produceJar( container.getBundleDirectory(), "service-impl.jar");
String expectedBundleSymbolicName = serviceProvider.getBundleSymbolicName();
container.start();